﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkflowLinks.aspx.cs" Inherits="SaaS.WorkflowLinks" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body background="img/bg.jpg">
    <form id="form1" runat="server">
    <div>
    
        <asp:HyperLink ID="HyperLink1" runat="server" 
            NavigateUrl="~/WorkflowEdit.aspx">&lt;- Back</asp:HyperLink>
        <br />
        <br />
        <asp:Label ID="Label1" runat="server" Text="Workflow ID:"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="lblWorkflowID" runat="server"></asp:Label>
        <br />
        <asp:Label ID="Label2" runat="server" Text="Workflow Name:"></asp:Label>
&nbsp;
        <asp:Label ID="lblWorkflowName" runat="server"></asp:Label>
        <br />
        <br />
        Workflow Output:
        <asp:DropDownList ID="ddlOutput" runat="server" Height="21px" 
            style="margin-left: 7px" Width="237px">
        </asp:DropDownList>
        <br />
        Workflow Input:
        <asp:DropDownList ID="ddlInput" runat="server" Height="19px" 
            style="margin-left: 19px" Width="235px">
        </asp:DropDownList>
        <br />
        <asp:Button ID="Button1" runat="server" style="margin-left: 209px" Text="Add" 
            onclick="Button1_Click" />
        <br />
        <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
        <br />
        <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" 
            GridLines="None" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:BoundField DataField="Data_Link_ID" HeaderText="Data_Link_ID" 
                    SortExpression="Data_Link_ID" Visible="False" />
                <asp:BoundField DataField="From_Tenant_Workflow_Service_ID" 
                    HeaderText="From_Tenant_Workflow_Service_ID" 
                    SortExpression="From_Tenant_Workflow_Service_ID" Visible="False" />
                <asp:BoundField DataField="Order_Number" HeaderText="From Order Number" 
                    SortExpression="Order_Number" />
                <asp:BoundField DataField="Service_ID" HeaderText="From Service ID" 
                    SortExpression="Service_ID" />
                <asp:BoundField DataField="Service_Function_Name" 
                    HeaderText="From Service Function" SortExpression="Service_Function_Name" />
                <asp:BoundField DataField="Data_Link_ID1" HeaderText="Data_Link_ID1" 
                    SortExpression="Data_Link_ID1" Visible="False" />
                <asp:BoundField DataField="To_Tenant_Workflow_Service_ID" 
                    HeaderText="To_Tenant_Workflow_Service_ID" 
                    SortExpression="To_Tenant_Workflow_Service_ID" Visible="False" />
                <asp:BoundField DataField="Order_Number1" HeaderText="To Order Number" 
                    SortExpression="Order_Number1" />
                <asp:BoundField DataField="Service_ID1" HeaderText="To Service ID" 
                    SortExpression="Service_ID1" />
                <asp:BoundField DataField="Service_Function_Name1" 
                    HeaderText="To Function Name" SortExpression="Service_Function_Name1" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MiniSaaSConnectionString %>" 
            SelectCommand="SELECT * FROM

(SELECT dl.Data_Link_ID, dl.From_Tenant_Workflow_Service_ID, tws.Order_Number, s.Service_ID, s.Service_Function_Name 
FROM DATA_LINK AS dl INNER JOIN TENANT_WORKFLOW_SERVICE AS tws ON dl.From_Tenant_Workflow_Service_ID = tws.Tenant_Workflow_Service_ID 
INNER JOIN SERVICE AS s ON tws.Service_ID = s.Service_ID 
WHERE (tws.Tenant_Workflow_Service_ID = @workflowID)) AS Expr1 INNER JOIN

(SELECT dl2.Data_Link_ID, dl2.To_Tenant_Workflow_Service_ID, tws2.Order_Number, s2.Service_ID , s2.Service_Function_Name 
FROM DATA_LINK AS dl2 INNER JOIN TENANT_WORKFLOW_SERVICE AS tws2 ON dl2.To_Tenant_Workflow_Service_ID = tws2.Tenant_Workflow_Service_ID 
INNER JOIN SERVICE AS s2 ON tws2.Service_ID = s2.Service_ID 
WHERE (tws2.Tenant_Workflow_Service_ID = @workflowID)) AS Expr2

ON Expr1.Data_Link_ID = Expr2.Data_Link_ID">
            <SelectParameters>
                <asp:ControlParameter ControlID="lblWorkflowID" Name="workflowID" 
                    PropertyName="Text" />
            </SelectParameters>
        </asp:SqlDataSource>
    
        <br />
    
    </div>
    </form>
</body>
</html>
